
from sqlalchemy import Column, Integer, String, Float, DateTime, UniqueConstraint, Text

from QualityInspectionViolation.DbInit.mysqlDb import Base, session
from QualityInspectionViolation.Model.Adviser import Adviser
from QualityInspectionViolation.Model.RoleMenu import RoleMenu


class MenuSynchronization(Base):
    __tablename__ = 'menu_synchronization'
    id = Column(Integer, primary_key=True)
    systemId = Column(Integer)
    menuInfo = Column(Text)
    createdAt = Column(DateTime)
    updatedAt = Column(DateTime)

    def queryMenuSynchronization(self, menuSynchronizationId, session):
        menuSynchronization = session.query(MenuSynchronization). \
            filter(MenuSynchronization.id == menuSynchronizationId).first()
        return menuSynchronization